<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('school/index')}">所有学校</a></li>
        <li class="active"><a href="{:url('school/add')}">添加学校</a></li>
        <!--<li><a  href="{:url('nav/edit')}" >{:lang('ADMIN_NAV_EDIT')}</a></li>-->
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('school/addPost')}">

        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>学校名称:</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="name" value="">
            </div>
        </div>

        <div class="form-group">
            <label for="input-user_email" class="col-sm-2 control-label"><span class="form-required">*</span>所在省份</label>
            <div class="col-md-6 col-sm-10">
                <select name='province' class="form-control" id="selectarea">
                    <option value="">--请选择所在省份--</option>
                    <foreach name="province" item="vo">
                        <option value="{$vo.areaId}">{$vo.areaName}</option>
                    </foreach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="input-user_email" class="col-sm-2 control-label"><span class="form-required">*</span>所在城市</label>
            <div class="col-md-6 col-sm-10">
                <select name='city' class="form-control"id="selectcity">
                    <option value="">--请选择所在城市--</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="input-user_email" class="col-sm-2 control-label"><span class="form-required">*</span>所在区县</label>
            <div class="col-md-6 col-sm-10">
                <select name='area' class="form-control"id="selectxian">
                    <option value="">--请选择所在区县--</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>请填写具体信息:</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="address" value="">
            </div>
        </div>

        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:lang("SAVE")}</button>
            <a class="btn btn-default" href="{:url('school/index')}">返回</a>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(function () {
        $('#selectarea').change('click',function () {
            var areaId=$('#selectarea').val();
            $.ajax({
                url:"{:url('school/getarea')}",
                type:"POST",
                data:{areaId:areaId},
                success:function (res) {
                    $('#selectcity').html(res);
                }
            });
        });
    })
</script>
<script>
    $(function () {
        $('#selectcity').change('click',function () {
            var areaId=$('#selectcity').val();
            $.ajax({
                url:"{:url('school/getcity')}",
                type:"POST",
                data:{areaId:areaId},
                success:function (res) {
                    $('#selectxian').html(res);
                }
            });
        });
    })
</script>
</body>
</html>